﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MvcFinalTest.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace MvcFinalTest.Models
{    
    public class BranchModel
    {
        public int BranchId { get; set; }

        [DisplayName("Name")]
        [Required(ErrorMessage = "Name is required.")] 
        [StringLength(25, ErrorMessage = "Name Can't Exceed 25 Characters")]
        public string Name { get; set; }

        [DisplayName("Address")]
        [Required(ErrorMessage = "Address is required.")]
        [StringLength(100, ErrorMessage = "Address Can't Exceed 100 Characters")]
        public string Address { get; set; }

        [DisplayName("Zip Code")]
        [Required(ErrorMessage = "Zip Code is required.")]
        [RegularExpression("^(0|[0-9][0-9]*)$", ErrorMessage = "Zip Code Must be Numeric")]
        [ZipCodeValidator(ErrorMessage = "Zip Code Must Have 5 Characters Length")]
        public string ZipCode { get; set; }
    }
}